package com.dk.mydemo.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.dk.mydemo.dao.DemoDao;
import com.dk.mydemo.modal.mybatis.Demo;

@Repository
public class DemoDaoImpl implements DemoDao {
	
    @Autowired  
    private SqlSessionTemplate sqlSessionTemplate; 

    @Override
	public Demo queryById(int id) {
		return sqlSessionTemplate.selectOne("queryById",id);
	}

    @Override
	public void save(Demo d) {
		sqlSessionTemplate.insert("insert-demo",d);
	}

}
